package com.bw.zonghe0719.adapter

import android.widget.TextView
import com.bw.base.entity.CouponEntity
import com.bw.base.entity.CouponEntityItem
import com.bw.zonghe0719.R
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder

class CouponAdapter:BaseQuickAdapter<CouponEntityItem,BaseViewHolder>(R.layout.item_coupon) {
    override fun convert(holder: BaseViewHolder, item: CouponEntityItem) {
        holder.getView<TextView>(R.id.coupon_money).text="￥${item.money}"
        holder.getView<TextView>(R.id.coupon_minprice).text="满${item.minPrice}"
        //判断是否已领取未使用
        if(item.isUse){
            holder.getView<TextView>(R.id.coupon_tv).text="已领取"
        }else{
            holder.getView<TextView>(R.id.coupon_tv).text="领取"
        }
    }
}